import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home', // 将根路径重定向到 /home
  },
  {
    path: '/home',
    component: () => import( '../views/views/home.vue'),
    children: [
      {
        path: '', // 子路由的空路径表示 /home 路径
        name: 'index',
        component: () => import( '../views/views/indexs/index.vue'),
      },
      // 添加其他子路由（如果有的话）
    ]
  },
  {
    path: '/test',
    name: 'Test',
    component: () => import('@/views/Home.vue'),
  },
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
